#include "../include/ModelInstance.h"

ModelInstance::ModelInstance(Model *model, GLfloat x, GLfloat y, GLfloat z, GLuint shaderProg, GLfloat rotation, GLfloat rotX, GLfloat rotY, GLfloat rotZ,
                             GLfloat scaleX,  GLfloat scaleY, GLfloat scaleZ){
    this->model = model;
    position.x = x;
    position.y = y;
    position.z = z;
    rotVec.x = rotX;
    rotVec.y = rotY;
    rotVec.z = rotZ;
    scale.x = scaleX;
    scale.y = scaleY;
    scale.z = scaleZ;
    this->shaderProg = shaderProg;
    this->rotation = rotation;
}

void ModelInstance::render(){
    glPushMatrix();
    glTranslatef(position.x, position.y, position.z);
    glRotatef(rotation, rotVec.x,rotVec.y,rotVec.z);
    glScalef(scale.x,scale.y,scale.z);
    model->render(shaderProg);
    glPopMatrix();
}

